package com.xiweicheng.test.jpa.entity;
// Generated 2018-7-13 22:08:49 by Hibernate Tools 5.0.6.Final

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;

/**
 * Translate generated by hbm2java
 */
@Entity
@Table(name = "translate", catalog = "tms")
public class Translate implements java.io.Serializable {

	private Long id;
	private long version;
	private Project project;
	private Date createDate;
	private String creator;
	private String description;
	private String key;
	private String search;
	private String status;
	private Date translateDate;
	private String translator;
	private Date updateDate;
	private String updater;
	private Set<TranslateItem> translateItems = new HashSet<TranslateItem>(0);
	private Set<File> files = new HashSet<File>(0);
	private Set<Label> labels = new HashSet<Label>(0);
	private Set<Users> userses = new HashSet<Users>(0);

	public Translate() {
	}

	public Translate(String creator, String key, String status) {
		this.creator = creator;
		this.key = key;
		this.status = status;
	}

	public Translate(Project project, Date createDate, String creator, String description, String key, String search,
			String status, Date translateDate, String translator, Date updateDate, String updater,
			Set<TranslateItem> translateItems, Set<File> files, Set<Label> labels, Set<Users> userses) {
		this.project = project;
		this.createDate = createDate;
		this.creator = creator;
		this.description = description;
		this.key = key;
		this.search = search;
		this.status = status;
		this.translateDate = translateDate;
		this.translator = translator;
		this.updateDate = updateDate;
		this.updater = updater;
		this.translateItems = translateItems;
		this.files = files;
		this.labels = labels;
		this.userses = userses;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)

	@Column(name = "id", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Version
	@Column(name = "version", nullable = false)
	public long getVersion() {
		return this.version;
	}

	public void setVersion(long version) {
		this.version = version;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "project_id")
	public Project getProject() {
		return this.project;
	}

	public void setProject(Project project) {
		this.project = project;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_date", length = 19)
	public Date getCreateDate() {
		return this.createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	@Column(name = "creator", nullable = false)
	public String getCreator() {
		return this.creator;
	}

	public void setCreator(String creator) {
		this.creator = creator;
	}

	@Column(name = "description", length = 2000)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Column(name = "_key", nullable = false)
	public String getKey() {
		return this.key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	@Column(name = "search")
	public String getSearch() {
		return this.search;
	}

	public void setSearch(String search) {
		this.search = search;
	}

	@Column(name = "status", nullable = false)
	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "translate_date", length = 19)
	public Date getTranslateDate() {
		return this.translateDate;
	}

	public void setTranslateDate(Date translateDate) {
		this.translateDate = translateDate;
	}

	@Column(name = "translator")
	public String getTranslator() {
		return this.translator;
	}

	public void setTranslator(String translator) {
		this.translator = translator;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "update_date", length = 19)
	public Date getUpdateDate() {
		return this.updateDate;
	}

	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}

	@Column(name = "updater")
	public String getUpdater() {
		return this.updater;
	}

	public void setUpdater(String updater) {
		this.updater = updater;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "translate")
	public Set<TranslateItem> getTranslateItems() {
		return this.translateItems;
	}

	public void setTranslateItems(Set<TranslateItem> translateItems) {
		this.translateItems = translateItems;
	}

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(name = "file_translate", catalog = "tms", joinColumns = {
			@JoinColumn(name = "translate_id", nullable = false, updatable = false) }, inverseJoinColumns = {
					@JoinColumn(name = "file_id", nullable = false, updatable = false) })
	public Set<File> getFiles() {
		return this.files;
	}

	public void setFiles(Set<File> files) {
		this.files = files;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "translate")
	public Set<Label> getLabels() {
		return this.labels;
	}

	public void setLabels(Set<Label> labels) {
		this.labels = labels;
	}

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(name = "watcher_translate", catalog = "tms", joinColumns = {
			@JoinColumn(name = "translate_id", nullable = false, updatable = false) }, inverseJoinColumns = {
					@JoinColumn(name = "user_id", nullable = false, updatable = false) })
	public Set<Users> getUserses() {
		return this.userses;
	}

	public void setUserses(Set<Users> userses) {
		this.userses = userses;
	}

}
